import { createContext } from 'react';

export type AuthStatus = 'loading' | 'signedIn' | 'signedOut';

export interface UserProfile {
  name?: string;
  sub?: string;
  claims?: Array<{ type: string; value: string }>;
  [key: string]: unknown;
}

export interface AuthContextValue {
  status: AuthStatus;
  user: UserProfile | null;
  error: string | null;
  isAuthenticated: boolean;
  refresh: () => Promise<void>;
  signIn: () => void;
  signOut: () => void;
}

export const AuthContext = createContext<AuthContextValue | null>(null);
